/*
 * @Description: 下载图纸按钮点击事件
 * @param :
 */
$("#download").click(function(){
	swal({
		title : "请稍等",
		text : "图纸下载中。。。。",
		type : "info",
		allowOutsideClick : false,
		allowEscapeKey : false,
		onBeforeOpen : function(){
			swal.showLoading();
		}
	});
	$.ajax({
		url : pathUrl("dispatch/downDrawing.action"),
		type : "POST",
		dataType : "JSON",
		data : {
			fNumber : fNumberData,
			fOperSN : fOperSNData
		},
		success : function(data) {
			if(data.code == "0000") {
				swal_Tips_Short(data.message);
			}else if(data.code == "9999") {
				swal_Tips(data.message);
			}
			initListTable();
		},
		error : function(request) {
			swal_Tips('请求出错!');
			swal_Tips_Error();
		},
		complete: function () {
		}
	});
});

$("#download2").click(function(){
	swal({
		title : "请稍等",
		text : "图纸下载中。。。。",
		type : "info",
		allowOutsideClick : false,
		allowEscapeKey : false,
		onBeforeOpen : function(){
			swal.showLoading();
		}
	});
	$.ajax({
		url : pathUrl("dispatch/downDrawing2.action"),
		type : "POST",
		dataType : "JSON",
		data : {
			fNumber : fNumberData,
			fOperSN : fOperSNData
		},
		success : function(data) {
			if(data.code == "0000") {
				swal_Tips_Short(data.message);
			}else if(data.code == "9999") {
				swal_Tips(data.message);
			}
			initListTable();
		},
		error : function(request) {
			swal_Tips('请求出错!');
			swal_Tips_Error();
		},
		complete: function () {
		}
	});
});
/*
 * @Description: 图纸列表
 * @param :
 */
function initListTable(){
	$("#PDFTable").bootstrapTable('destroy').bootstrapTable({
		url : pathUrl("dispatch/findDrawing.action"),
//		height : $(window).height()*0.9,//行高
		method : "POST",
		//striped : true,
		cache : false,
		sidePagination : "client", // 分页方式：client客户端分页，server服务端分页（*）
//		pagination : true,
//		pageNumber : 1,
//		pageSize : 10,
//		pageList : [ 10, 30, 60, 100, 'ALL' ],
		queryParams : function(params) {
			var data = {};
//			data.offset = params.offset +1;
			data.row = 100000;
			data.fNumber = fNumberData;//产品代码
			data.fOperSN = fOperSNData;//助记码或图号
//			data.orderBy = orderBy;//排序：要排序字段 + 排序规则
			return data;
		},
		dataType : 'JSON',
		uniqueId : "",
		columns : [ 
		{
			field : '',
			align : 'left',
			valign: 'middle',
			title : '序号',
			width : 50,
			edit : false,
			formatter : function(value,row,index){
				return index+1;
			}
		},{
			field : 'fName',
			align : 'left',
			valign: 'middle',
			title : '图纸名称',
			edit : false,
			formatter : function(value,row,index){
				return '<a href="javascript:void(0);" class="TZName">'+value+'</a>';
			},
			events : operateEvents
		}]
	})
}
